home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / N-P / NIFTY / myCShell / start.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-17  |  2.0 KB  |  102 lines  |  [TEXT/KAHL]

  1. /*********************************************************
  2.  "start.c"
  3.  
  4.  by John A. Love, III [ Washington Apple Pi Users' Group]
  5.  
  6.  using Symantec's "THINK C", v 5.00
  7.  *********************************************************/
  8.  
  9.  
  10. #include "protos"
  11.  
  12. #include "globals.h"
  13. #include "extern.h"
  14.  
  15. #include "ADBLights.h"
  16. #include "floatingWindow.h"
  17.  
  18.  
  19. void    main (void);
  20.  
  21.  
  22.  
  23.  
  24. void main (void)    {
  25.  
  26.         WindowPtr    floatTool;
  27.         PicHandle    floatPict, centeredPic;
  28.         Rect        windRect, centeredPictRect;
  29.         
  30.         
  31.     InitManagers();                                /* The usual stuff ... */
  32.     ;
  33.     {
  34.             short    *ROM = (wordPtr)(ROM85Loc);
  35.  
  36.         if (*ROM > 0)    gMBarHt = GetMBarHeight();
  37.         else    ExitToShell();                    /* NO workee !!! */
  38.     }
  39.     ;
  40.     SetCursor(*GetCursor(watchCursor));
  41.  
  42.     // Init some Globals ...
  43.     gInitAppleEvents = InitAppleEvents();        /* errs in "AppleEvents.c" ... */
  44.     gInitPPCToolbox = InitPPCToolbox();
  45.     gSys7 = System7isUp();
  46.     gStripAddressMask = GetStripAddressMask();
  47.     gDone = false;
  48.     gInForeGround = true;                        /* Assume Unifinder. */
  49.     gWNE = WNEisImplemented();
  50.     gStartBalloons = BalloonsOn();
  51.     gLastBalloon = -1;                            /* = notMine. */
  52.     gMac2 = TestForColor(&gColorDepth);            /* Feeds InitBigScreen. */
  53.     InitBigScreen(&gFPDRsrc, &gSizeFont);
  54.     
  55.     Init_Help();
  56.     TInitWindows();
  57.  
  58.     System7Braggart();
  59.  
  60.     SetUpMainMenus();
  61.  
  62.     DoSpiffyIris();
  63.     
  64.     floatTool = TMakeNewTool(FLOAT, nil, inFront);
  65.     if (floatTool)        {
  66.         floatPict = GetPicture(FLOAT);
  67.         if (floatPict)        {
  68.             windRect = floatTool->portRect;
  69.             centeredPictRect = (**floatPict).picFrame;
  70.             CenterRects(¢eredPictRect, &windRect);
  71.             ;
  72.             centeredPic = OpenPicture(&windRect);
  73.             ClipRect(&windRect);
  74.             EraseRect(&windRect);
  75.             DrawPicture(floatPict, ¢eredPictRect);
  76.             ClosePicture();
  77.             ;
  78.             SetWindowPic(floatTool, centeredPic);
  79.             ReleaseResource(floatPict);        /* Kiss the original good-bye !! */
  80.         }
  81.         TShowWindow(floatTool);
  82.     }
  83.     
  84.     MainEventLoop();
  85.  
  86.     ResetBalloons(gStartBalloons);
  87.     PlaySound("Moof");
  88.     
  89.     InstallVBLTask(acurDogCow);
  90.     BlinkAllADBLights();
  91.     RemoveVBLTask();
  92.     ;
  93.     ExitToShell();
  94.     
  95.     
  96. }    /* main */
  97.  
  98.  
  99.  
  100.  
  101. /*    { end file "start.c" }  */
  102.